package com.vhall.component.entity.goods.goods;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.vhall.component.framework.common.annotation.ParamName;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.io.Serializable;

/**
 * @author guoxin.wang
 * @date 2021/10/12
 */
@Data
public class GoodsConsoleCreateReqVO implements Serializable {

    private static final long serialVersionUID = 8319812567138564348L;

    /**
     * required 商品名称
     */
    @NotBlank(message = "name参数不允许为空")
    @Size(max = 30, message = "商品名称过长，限制30个字符")
    private String name;

    /**
     * required 商品描述
     */
    @Size(max = 100, message = "产品描述过长，限制100个字符")
    @ParamName("goods_tag")
    @JsonProperty("goods_tag")
    private String goodsTag;

    /**
     * required 商品链接-h5
     */
//    @Pattern(regexp = "(\\\\s)?|(http(s)?://([\\w-]+\\.)+[\\w-]+[:]?([\\d]+)*(/[\\w- :./?%&=]*)?)", message = "商品链接格式不正确")
    @Size(max = 1000, message = "链接长度过长")
    @ParamName("goods_url")
    @JsonProperty("goods_url")
    private String goodsUrl;


    /**
     * required 商品图片
     */
    @Size(max = 1000, message = "商品图片 链接长度过长")
    private String pic;

    /**
     * 商品链接-端内
     */
    @Size(max = 1000, message = "商品链接-端内 链接长度过长")
    @ParamName(value = "goods_url_android")
    @JsonProperty(value = "goods_url_android")
    private String goodsUrlAndroid;

    /**
     * 商品链接-ios
     */
    @Size(max = 1000, message = "ios链接长度过长")
    @ParamName(value = "goods_url_ios")
    @JsonProperty(value = "goods_url_ios")
    private String goodsUrlIos;

    /**
     * 商品按钮文字
     */
    @NotBlank(message = "商品按钮文字 参数不允许为空")
    @Size(max = 128, message = "商品按钮文字 长度过长")
    @ParamName(value = "product_button_text")
    @JsonProperty(value = "product_button_text")
    private String productButtonText;

}
